<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>日志系列四之log4j框架 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Appender　　在log4j中，我们可以将日志输出到不同的地方，该功能的实现主要是由log4j提供的不同的Appender完成。下图所示红框内的为常用的几个，下面介绍另外几个重要的Appender。这里不再提供配置实例。　　1. JDBCAppender：将日志写入数据库，里面的实现居然是短连接，每次插入数据时都要与数据库建立连接，然后断开连接，好鸡肋的功能！　　2. SocketAppend">
<meta property="og:type" content="article">
<meta property="og:title" content="日志系列四之log4j框架">
<meta property="og:url" content="http://yoursite.com/2015/12/15/log/4.日志系列之log4j框架/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Appender　　在log4j中，我们可以将日志输出到不同的地方，该功能的实现主要是由log4j提供的不同的Appender完成。下图所示红框内的为常用的几个，下面介绍另外几个重要的Appender。这里不再提供配置实例。　　1. JDBCAppender：将日志写入数据库，里面的实现居然是短连接，每次插入数据时都要与数据库建立连接，然后断开连接，好鸡肋的功能！　　2. SocketAppend">
<meta property="og:image" content="http://yoursite.com/images/log4j-appender.jpg">
<meta property="og:updated_time" content="2016-01-29T17:47:36.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="日志系列四之log4j框架">
<meta name="twitter:description" content="Appender　　在log4j中，我们可以将日志输出到不同的地方，该功能的实现主要是由log4j提供的不同的Appender完成。下图所示红框内的为常用的几个，下面介绍另外几个重要的Appender。这里不再提供配置实例。　　1. JDBCAppender：将日志写入数据库，里面的实现居然是短连接，每次插入数据时都要与数据库建立连接，然后断开连接，好鸡肋的功能！　　2. SocketAppend">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-log/4.日志系列之log4j框架" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2015/12/15/log/4.日志系列之log4j框架/" class="article-date">
  <time datetime="2015-12-14T20:00:00.000Z" itemprop="datePublished">2015-12-15</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/log/">log</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      日志系列四之log4j框架
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="Appender"><a href="#Appender" class="headerlink" title="Appender"></a>Appender</h2><p>　　在log4j中，我们可以将日志输出到不同的地方，该功能的实现主要是由log4j提供的不同的Appender完成。下图所示红框内的为常用的几个，下面介绍另外几个重要的Appender。这里不再提供配置实例。<br>　　1. JDBCAppender：将日志写入数据库，里面的实现居然是短连接，每次插入数据时都要与数据库建立连接，然后断开连接，好鸡肋的功能！<br>　　2. SocketAppender：将日志通过Socket连接，发送到远程服务器上，注意，该SocketAppender无需配置layout，其是将LoggingEvent（包括了所有的日志信息）直接进行序列化，再通过网络发送。此时socket不会断开，连接一直保存。在log4j的源码中，作者也提供了服务端的实现，用来接收日志，详见包org.apache.log4j.net<br>　　3. SMTPAppender：发送日志给邮件<br><img src="/images/log4j-appender.jpg" alt="log4j-appender.jpg"></p>
<h2 id="Level"><a href="#Level" class="headerlink" title="Level"></a>Level</h2><p>　　level优先级分别为OFF、FATAL、ERROR、WARN、INFO、DEBUG、ALL7个级别。Log4j建议只使用四个级别，通过定义的级别，你可以控制程序中的日志输出。比如在这里定义了ERROR级别，程序中只有FARAL、ERROR 级别的LOG会被输出。</p>
<h2 id="Layout"><a href="#Layout" class="headerlink" title="Layout"></a>Layout</h2><p>　　log4j为日志的输出格式提供了如下几种模板：<br>　　1. HTMLLayout：以HTML表格形式布局<br>　　2. SimpleLayout：包含日志信息的级别和信息字符串<br>　　3. TTCCLayout：包含日志产生的时间、线程、类别等等信息<br>　　4. PatternLayout：可以灵活地指定布局模式</p>
<h2 id="additivity"><a href="#additivity" class="headerlink" title="additivity"></a>additivity</h2><p>　　子Logger 是否继承父 Logger 的 输出源（appender）的标志位。具体说，默认情况下子Logger会继承父Logger的appender，也就是说子Logger会在父Logger的appender里输出。若是additivity设为false，则子Logger只会在自己的appender里输出，而不会在父Logger的appender里输出。<br>　　在log4j中，基本上我们都会配置一个rootLogger，由于输出系统中所有的日志。但是，我们会遇到这样一个需求：将某个包下的日志单独输出到其他地方，无需再通过rootLogger的配置进行输出，那么此时该怎么办呢？这个时候additivity就派上用场了。如下所示，包com.mapbar.push.web.dao下的所有日志都单独输出到xxxxxx.log文件中<br><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">#此处配置可以打印出sql</span><br><span class="line">log4j.additivity.com.mapbar.push.web.dao=false</span><br><span class="line">log4j.logger.com.mapbar.push.web.dao=ERROR,SQLFILE</span><br><span class="line">log4j.appender.SQLFILE=org.apache.log4j.DailyRollingFileAppender</span><br><span class="line">log4j.appender.SQLFILE.File=xxxxxx.log</span><br><span class="line">log4j.appender.SQLFILE.Append=true</span><br><span class="line">log4j.appender.SQLFILE.Encoding=utf-8</span><br><span class="line">log4j.appender.SQLFILE.layout=org.apache.log4j.PatternLayout</span><br><span class="line">log4j.appender.SQLFILE.layout.ConversionPattern=[push-web] %d [%t] %-5p - %m%n</span><br></pre></td></tr></table></figure></p>
<h2 id="Hierarchy"><a href="#Hierarchy" class="headerlink" title="Hierarchy"></a>Hierarchy</h2><p>　　Hierarchy继承自LoggerRepository。顾名思义，它就是一个Logger实例的容器：一方面相同名字的Logger实例只需要创建一次，在后面的使用中，只需要从这个容器中取即可；另一方面，Logger容器可以存放从配置文件中解析出来的信息，从而使配置信息可以无缝的应用到Log4J内部系统中；最后Logger容器还为维护Logger的树状层次结构提供了方面，每个Logger只维护父节点的信息，有了Logger容器的存在则可以很容易的找到一个新的Logger实例的父节点；</p>
<h2 id="Filter"><a href="#Filter" class="headerlink" title="Filter"></a>Filter</h2><p>　　在Log4J中，Filter组成一条链，它定义了decide()方法，由子类实现，若返回DENY则日志不会被记录、NEUTRAL则继续检查下一个Filter实例、ACCEPT则Filter通过，继续执行后面的写日志操作。使用Filter可以为Appender加入一些除了threshold以外的其他逻辑，由于它本身是链状的，而且它的执行是横跨在Appender的doAppend方法中，因而这也是一个典型的AOP的概念。也类似于Servlet中的过滤器概念，只是在实现细节上存在细微的区别。<br><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">abstract</span> <span class="class"><span class="keyword">class</span> <span class="title">Filter</span> <span class="keyword">implements</span> <span class="title">OptionHandler</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">  <span class="keyword">public</span> Filter next;</span><br><span class="line"></span><br><span class="line">  <span class="comment">/**</span><br><span class="line">     The log event must be dropped immediately without consulting</span><br><span class="line">     with the remaining filters, if any, in the chain.  */</span></span><br><span class="line">  <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> DENY    = -<span class="number">1</span>;</span><br><span class="line">  </span><br><span class="line">  <span class="comment">/**</span><br><span class="line">     This filter is neutral with respect to the log event. The</span><br><span class="line">     remaining filters, if any, should be consulted for a final decision.</span><br><span class="line">  */</span></span><br><span class="line">  <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> NEUTRAL = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">  <span class="comment">/**</span><br><span class="line">     The log event must be logged immediately without consulting with</span><br><span class="line">     the remaining filters, if any, in the chain.  */</span></span><br><span class="line">  <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> ACCEPT  = <span class="number">1</span>;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">  <span class="comment">/**</span><br><span class="line">     Usually filters options become active when set. We provide a</span><br><span class="line">     default do-nothing implementation for convenience.</span><br><span class="line">  */</span></span><br><span class="line">  <span class="function"><span class="keyword">public</span></span><br><span class="line">  <span class="keyword">void</span> <span class="title">activateOptions</span><span class="params">()</span> </span>&#123;</span><br><span class="line">  &#125;</span><br><span class="line"></span><br><span class="line">  <span class="comment">/**     </span><br><span class="line">     &lt;p&gt;If the decision is &lt;code&gt;DENY&lt;/code&gt;, then the event will be</span><br><span class="line">     dropped. If the decision is &lt;code&gt;NEUTRAL&lt;/code&gt;, then the next</span><br><span class="line">     filter, if any, will be invoked. If the decision is ACCEPT then</span><br><span class="line">     the event will be logged without consulting with other filters in</span><br><span class="line">     the chain.</span><br><span class="line"></span><br><span class="line">     <span class="doctag">@param</span> event The LoggingEvent to decide upon.</span><br><span class="line">     <span class="doctag">@return</span> decision The decision of the filter.  */</span></span><br><span class="line">  <span class="function"><span class="keyword">abstract</span></span><br><span class="line">  <span class="keyword">public</span></span><br><span class="line">  <span class="keyword">int</span> <span class="title">decide</span><span class="params">(LoggingEvent event)</span></span>;</span><br><span class="line"></span><br><span class="line">  <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setNext</span><span class="params">(Filter next)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">this</span>.next = next;</span><br><span class="line">  &#125;</span><br><span class="line"> </span><br><span class="line">  <span class="function"><span class="keyword">public</span> Filter <span class="title">getNext</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> next;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="LoggingEvent"><a href="#LoggingEvent" class="headerlink" title="LoggingEvent"></a>LoggingEvent</h2><p>　　LoggingEvent个人感觉用LoggingContext更合适一些，它是对一次日志记录时哪能获取到的数据的封装。它包含了以下信息以提供Layout在format()方法中使用：</p>
<ol>
<li>fqnOfCategoryClass：日志记录接口（默认为Logger）的类全名，该信息主要用于计算日志记录点的源文件、调用方法以及行号等位置信息。</li>
<li>locationInfo：通过fqnOfCategoryClass计算位置信息，位置信息的计算由LocationInfo类实现，这些信息可以提供给Layout使用。</li>
<li>logger：目前来看主要是通过Logger实例取得LogRepository实例，并通过LogRepository取得注册的ObjectRender实例，如果有的话。</li>
<li>loggerName：当前日志记录的Logger名称，提供给Layout使用。</li>
<li>threadName：当前线程名，提供给Layout使用。</li>
<li>level：当前日志的级别，提供给Layout使用。</li>
<li>message：当前日志类，一般是String类型，但是也可以通过注册ObjectRender，然后传入相应的其他对象类型。</li>
<li>renderedMessage：经过ObjectRender处理后的日志信息，提供给Layout使用。</li>
<li>throwableInfo：异常信息，如果存在的话，提供给Layout使用。</li>
<li>timestamp：创建LoggingEvent实例的时间，提供给Layout使用。</li>
<li>其他相对不常用的信息将会在后面小节中讲解。<h2 id="ObjectRender"><a href="#ObjectRender" class="headerlink" title="ObjectRender"></a>ObjectRender</h2>　　Log4J中，对传入的message实例，如果是非String类型，会先使用注册的ObjectRender（在LogRepository中查找注册的ObjectRender信息）处理成String后返回，若没有找到相应的ObjectRender，则使用默认的ObjectRender，它只是调用该消息实例的toString()方法。</li>
</ol>
<h2 id="u914D_u7F6E_u793A_u4F8B"><a href="#u914D_u7F6E_u793A_u4F8B" class="headerlink" title="配置示例"></a>配置示例</h2><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"># 打开调试模式，输出log4j自身的日志信息</span><br><span class="line">log4j.debug=true</span><br><span class="line"># 设置最小阀值，此时系统输出的级别只会有INFO、WARN和ERROR等，防止其他Logger实例没有设置Level值的情况</span><br><span class="line">log4j.threshold=INFO</span><br><span class="line"># threshold设置为INFO，这里rootLogger设置为TRACE无效，最低级别仍然为INFO</span><br><span class="line">log4j.rootLogger=TRACE,CONSOLE,FILE</span><br><span class="line"></span><br><span class="line">log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender</span><br><span class="line">log4j.appender.CONSOLE.Encoding=utf-8</span><br><span class="line">log4j.appender.CONSOLE.Target=System.out </span><br><span class="line">log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout</span><br><span class="line">log4j.appender.CONSOLE.layout.ConversionPattern=[slf4j-demo] %d - %c -%-4r [%t] %-5p - %m%n</span><br><span class="line"></span><br><span class="line">log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender</span><br><span class="line">log4j.appender.FILE.File=demo.log</span><br><span class="line">log4j.appender.FILE.Append=true </span><br><span class="line">log4j.appender.FILE.Encoding=utf-8</span><br><span class="line">log4j.appender.FILE.layout=org.apache.log4j.PatternLayout </span><br><span class="line">log4j.appender.FILE.layout.ConversionPattern=[slf4j-demo] %d - %c -%-4r [%t] %-5p - %m%n</span><br></pre></td></tr></table></figure>
<p>下面附上一张调试模式下log4j自身的日志信息<br>log4j: Hierarchy threshold set to [INFO].<br>log4j: Parsing for [root] with value=[TRACE,CONSOLE,FILE].<br>log4j: Level token is [TRACE].<br>log4j: Category root set to TRACE<br>log4j: Parsing appender named “CONSOLE”.<br>log4j: Parsing layout options for “CONSOLE”.<br>log4j: Setting property [conversionPattern] to [[slf4j-demo] %d - %c -%-4r [%t] %-5p - %m%n].<br>log4j: End of parsing for “CONSOLE”.<br>log4j: Setting property [encoding] to [utf-8].<br>log4j: Setting property [target] to [System.out ].<br>log4j: Parsed “CONSOLE” options.<br>log4j: Parsing appender named “FILE”.<br>log4j: Parsing layout options for “FILE”.<br>log4j: Setting property [conversionPattern] to [[slf4j-demo] %d - %c -%-4r [%t] %-5p - %m%n].<br>log4j: End of parsing for “FILE”.<br>log4j: Setting property [append] to [true].<br>log4j: Setting property [encoding] to [utf-8].<br>log4j: Setting property [file] to [demo.log].<br>log4j: setFile called: demo.log, true<br>log4j: setFile ended<br>log4j: Appender [FILE] to be rolled at midnight.<br>log4j: Parsed “FILE” options.<br>log4j: Finished configuring.<br>org.slf4j.impl.Log4jLoggerAdapter(Demo)</p>
<h2 id="u53C2_u8003_u8D44_u6599"><a href="#u53C2_u8003_u8D44_u6599" class="headerlink" title="参考资料"></a>参考资料</h2><p><a href="http://www.blogjava.net/DLevin/archive/2012/06/28/381667.html" target="_blank" rel="external">http://www.blogjava.net/DLevin/archive/2012/06/28/381667.html</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2015/12/15/log/4.日志系列之log4j框架/" data-id="cijzzpvbz00ar1cfsok2q2736" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/log/">log</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/log4j/">log4j</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2015/12/15/log/5.logback系列之入门/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          logback系列一之入门
        
      </div>
    </a>
  
  
    <a href="/2015/12/15/log/3.日志系列之log4j初始化/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">日志系列三之log4j初始化</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/cache/">cache</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/">docker</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gis/">gis</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/go/">go</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gradle/">gradle</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/groovy/">groovy</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hadoop/">hadoop</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/java/">java</a><span class="category-list-count">18</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/log/">log</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/">mongodb</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mq/">mq</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mybatis/">mybatis</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/netty/">netty</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nginx/">nginx</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nio/">nio</a><span class="category-list-count">19</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/redis/">redis</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/rpc/">rpc</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/spring/">spring</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/tomcat/">tomcat</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zookeeper/">zookeeper</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/杂项/">杂项</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/aop/">aop</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/aspectj/">aspectj</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/classloader/">classloader</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/common-loggings/">common-loggings</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/commonjs/">commonjs</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dubbo/">dubbo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fastdfs/">fastdfs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gclib/">gclib</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geohash/">geohash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gis/">gis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/">gradle</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovy/">groovy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hadoop/">hadoop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hessisan/">hessisan</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">48</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javassist/">javassist</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kafka/">kafka</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log4j/">log4j</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logback/">logback</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/map/">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memecached/">memecached</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mina/">mina</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongodb/">mongodb</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mq/">mq</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mqtt/">mqtt</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mybatis/">mybatis</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netty/">netty</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nio/">nio</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgresql/">postgresql</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/proxy/">proxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/push/">push</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rabbitmq/">rabbitmq</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpc/">rpc</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sitemesh/">sitemesh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sld/">sld</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/slf4j/">slf4j</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/socket/">socket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spatialite-for-android/">spatialite for android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spi/">spi</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/">spring</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tomcat/">tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/transaction/">transaction</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xSocket/">xSocket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zbus/">zbus</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zookeeper/">zookeeper</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/数据结构/">数据结构</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/aop/" style="font-size: 15.38px;">aop</a> <a href="/tags/aspectj/" style="font-size: 11.54px;">aspectj</a> <a href="/tags/cache/" style="font-size: 11.54px;">cache</a> <a href="/tags/classloader/" style="font-size: 10px;">classloader</a> <a href="/tags/common-loggings/" style="font-size: 10px;">common-loggings</a> <a href="/tags/commonjs/" style="font-size: 12.31px;">commonjs</a> <a href="/tags/database/" style="font-size: 16.92px;">database</a> <a href="/tags/docker/" style="font-size: 13.85px;">docker</a> <a href="/tags/dubbo/" style="font-size: 10px;">dubbo</a> <a href="/tags/fastdfs/" style="font-size: 10px;">fastdfs</a> <a href="/tags/gclib/" style="font-size: 10.77px;">gclib</a> <a href="/tags/geohash/" style="font-size: 10px;">geohash</a> <a href="/tags/gis/" style="font-size: 10px;">gis</a> <a href="/tags/git/" style="font-size: 10.77px;">git</a> <a href="/tags/go/" style="font-size: 10px;">go</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/groovy/" style="font-size: 10px;">groovy</a> <a href="/tags/hadoop/" style="font-size: 10px;">hadoop</a> <a href="/tags/hessisan/" style="font-size: 11.54px;">hessisan</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/javassist/" style="font-size: 10px;">javassist</a> <a href="/tags/kafka/" style="font-size: 11.54px;">kafka</a> <a href="/tags/linux/" style="font-size: 12.31px;">linux</a> <a href="/tags/log/" style="font-size: 17.69px;">log</a> <a href="/tags/log4j/" style="font-size: 12.31px;">log4j</a> <a href="/tags/logback/" style="font-size: 13.08px;">logback</a> <a href="/tags/map/" style="font-size: 10px;">map</a> <a href="/tags/memecached/" style="font-size: 10.77px;">memecached</a> <a href="/tags/mina/" style="font-size: 13.08px;">mina</a> <a href="/tags/mongodb/" style="font-size: 19.23px;">mongodb</a> <a href="/tags/mq/" style="font-size: 13.85px;">mq</a> <a href="/tags/mqtt/" style="font-size: 10.77px;">mqtt</a> <a href="/tags/mybatis/" style="font-size: 16.15px;">mybatis</a> <a href="/tags/netty/" style="font-size: 10px;">netty</a> <a href="/tags/nginx/" style="font-size: 11.54px;">nginx</a> <a href="/tags/nio/" style="font-size: 13.08px;">nio</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/postgresql/" style="font-size: 10.77px;">postgresql</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/proxy/" style="font-size: 10px;">proxy</a> <a href="/tags/push/" style="font-size: 10px;">push</a> <a href="/tags/rabbitmq/" style="font-size: 11.54px;">rabbitmq</a> <a href="/tags/redis/" style="font-size: 13.85px;">redis</a> <a href="/tags/rpc/" style="font-size: 19.23px;">rpc</a> <a href="/tags/sitemesh/" style="font-size: 10px;">sitemesh</a> <a href="/tags/sld/" style="font-size: 10px;">sld</a> <a href="/tags/slf4j/" style="font-size: 10px;">slf4j</a> <a href="/tags/socket/" style="font-size: 14.62px;">socket</a> <a href="/tags/spatialite-for-android/" style="font-size: 10px;">spatialite for android</a> <a href="/tags/spi/" style="font-size: 10px;">spi</a> <a href="/tags/spring/" style="font-size: 18.46px;">spring</a> <a href="/tags/tomcat/" style="font-size: 10.77px;">tomcat</a> <a href="/tags/transaction/" style="font-size: 10px;">transaction</a> <a href="/tags/web/" style="font-size: 10px;">web</a> <a href="/tags/xSocket/" style="font-size: 14.62px;">xSocket</a> <a href="/tags/zbus/" style="font-size: 10px;">zbus</a> <a href="/tags/zookeeper/" style="font-size: 10.77px;">zookeeper</a> <a href="/tags/数据结构/" style="font-size: 10.77px;">数据结构</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">67</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">81</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/01/30/资料/">(no title)</a>
          </li>
        
          <li>
            <a href="/2016/01/30/java/13.Classloader系列一/">ClassLoader系列一</a>
          </li>
        
          <li>
            <a href="/2016/01/29/hadoop/1.hadoop系列之源码编译/">hadoop系列一之源码编译</a>
          </li>
        
          <li>
            <a href="/2016/01/29/go/1.GO系列之入门/">Go系列一之入门</a>
          </li>
        
          <li>
            <a href="/2016/01/28/tomcat/2.tomcat性能优化/">tomcat性能优化</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>